
app.config(["$stateProvider", "$urlRouterProvider", function ($stateProvider, $urlRouterProvider) {
    // $urlRouterProvider.otherwise("/app/login");
    $stateProvider
    // app
        .state("app", {
            url: "/app",
            templateUrl: "./tpl/work/app.html",
            controller: 'appCtrl'
        })
        .state("app.login", {
            url: "/login",
            templateUrl: "./tpl/login.html",
            controller:'loginCtrl'
        })
        .state("app.signUp", {
            title:'注册',
            url: "/signUp",
            templateUrl: "./tpl/signUp.html",
            controller:'signUpCtrl'
        })
        .state("app.resetPwd", {
            title:'找回密码',
            url: "/resetPwd",
            templateUrl: "./tpl/resetPwd.html",
            controller:'resetPwdCtrl'
        })

        // rates
        .state("app.rates", {
            url: "/rates?instrument",
            template: "<div ui-view></div>"
        })
        .state("app.rates.list", {
            url: "/ratesList",
            templateUrl: "./tpl/work/app_rates_list.html",
            controller: "ratesCtrl"
        })
        .state("app.rates.analysis", {
            url: "/ratesAnalysis",
            templateUrl: "./tpl/work/app_rates_list_analysis.html",
            controller: "analysisCtrl"
        })
        .state("app.rates.detail", {
            url: "/ratesDetail",
            templateUrl: "./tpl/work/app_rates_list_detail.html",
            controller: "detailCtrl"
        })
        .state("app.rates.handle", {
            url: "/ratesHandle",
            templateUrl: "./tpl/work/app_rates_list_handle.html",
            controller: "handleCtrl"
        })
        // signal
        .state("app.signal", {
            url: "/signal",
            template: "<div ui-view></div>"
        })
        .state("app.signal.list", {
            url: "/signalList",
            templateUrl: "./tpl/work/app_signal_list.html",
            controller: 'signalCtrl'
        })
        // calendar
        .state("app.calendar", {
            url: "/calendar",
            template: "<div ui-view></div>"
        })
        .state("app.calendar.list", {
            url: "/calendarList",
            templateUrl: "./tpl/work/app_calendar_list.html",
            controller: 'calendarCtrl'
        })
        // video
        .state("app.video", {
            url: "/video?videoId",
            template: "<div ui-view></div>"
        })
        .state("app.video.list", {
            url: "/videoList",
            templateUrl: "./tpl/work/app_video_list.html",
            controller: 'videosCtrl'
        })
        .state("app.video.detail", {
            url: "/videoDetail",
            templateUrl: "./tpl/work/app_video_detail.html",
        })
        .state("app.video.detail.player", {
            url: "/player",
            templateUrl: "./tpl/work/app_video_player.html",
            controller: "videoPlayCtrl"
        })
        // more
        .state("app.more", {
            url: "/more",
            template: "<div ui-view></div>"
        })
        .state("app.more.list", {
            url: "/moreList",
            templateUrl: "./tpl/work/app_more_list.html",
            controller: 'moreCtrl'
        })
        .state("app.redeem", {
            url:"/redeem",
            templateUrl:"./tpl/work/redeem.html",
            controller:'redeemCtrl'
        })
        .state("app.me", {
            url: "/me",
            template:"<div ui-view></div>",
            // deps: function(uiLoad){
            //     return uiLoad.load('scripts/controllers/signal_release.js');
            // }
            // resolve: {
            //     deps: function($ocLazyLoad) {
            //         return $ocLazyLoad.load(["js/me.js"]);
            //     }
            // }
        })
        .state("app.me.detail", {
            url: "/myDetail",
            templateUrl: "./tpl/work/me_myDetail.html",
            controller: 'myDetailCtrl',
        })
        .state("app.me.updateInfo", {
            title:'昵称',
            url:"/updateInfo",
            templateUrl:"./tpl/work/me_update_info.html",
            controller:'updateInfoCtrl'
        })
        .state("app.me.updatePassword", {
            title:'密码设置',
            url:"/updatePassword",
            templateUrl:"./tpl/work/me_update_password.html",
            controller:'updatePasswordCtrl'
        })
        .state("app.me.coupon", {
            url:"/myCoupon",
            templateUrl:"./tpl/work/me_coupon.html",
            controller:'myCouponCtrl'
        })
        .state("app.me.deposit", {
            url:"/deposit",
            templateUrl:"./tpl/work/me_deposit.html",
            controller:'depositCtrl'
        })
        .state("app.me.deposit.select", {
            title:'选择开通时长',
            url:"/select",
            templateUrl:"./tpl/work/me_deposit_select.html"
        })
        .state("app.me.deposit.create", {
            title:'确认订单',
            url:"/create",
            templateUrl:"./tpl/work/me_deposit_create.html"
        })
        .state("app.me.deposit.pay", {
            title:'支付',
            url:"/pay",
            templateUrl:"./tpl/work/me_deposit_pay.html"
        })
        .state("app.me.deposit.finish", {
            title:'支付完成',
            url:"/finish",
            templateUrl:"./tpl/work/me_deposit_finish.html"
        })
        .state("app.me.depositRecord", {
            url:"/depositRecord",
            templateUrl:"./tpl/work/me_deposit_record.html",
            controller:'depositRecordCtrl'
        })
}]);